# $Id: PKGBUILD 182633 2013-04-11 17:22:52Z foutrelis $
# Maintainer: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jaroslaw Swierczynski <swiergot@juvepoland.com>
# Contributor: Michal Hybner <dta081@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgbase=firefox-i18n
pkgver=20.0.1
pkgrel=1
pkgdesc="Language pack for Firefox"
arch=('any')
url="http://www.mozilla.com/"
license=('MPL' 'GPL')
depends=("firefox>=$pkgver")

_languages=(
  'ach    "Acoli"'
  'af     "Afrikaans"'
  'ak     "Akan"'
  'ar     "Arabic"'
  'as     "Assamese"'
  'ast    "Asturian"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'bn-BD  "Bengali (Bangladesh)"'
  'bn-IN  "Bengali (India)"'
  'br     "Breton"'
  'bs     "Bosnian"'
  'ca     "Catalan"'
  'cs     "Czech"'
  'csb    "Kashubian"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'el     "Greek"'
  'en-GB  "English (United Kingdom)"'
  'en-US  "English (United States)"'
  'en-ZA  "English (South Africa)"'
  'eo     "Esperanto"'
  'es-AR  "Spanish (Argentina)"'
  'es-CL  "Spanish (Chile)"'
  'es-ES  "Spanish (Spain)"'
  'es-MX  "Spanish (Mexico)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fa     "Persian"'
  'ff     "Fula"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian (Netherlands)"'
  'ga-IE  "Irish"'
  'gd     "Gaelic"'
  'gl     "Galician"'
  'gu-IN  "Gujarati (India)"'
  'he     "Hebrew"'
  'hi-IN  "Hindi (India)"'
  'hr     "Croatian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'kk     "Kazakh"'
  'km     "Khmer"'
  'kn     "Kannada"'
  'ko     "Korean"'
  'ku     "Kurdish"'
  'lg     "Ganda"'
  'lij    "Ligurian"'
  'lt     "Lithuanian"'
  'lv     "Latvian"'
  'mai    "Maithili"'
  'mk     "Macedonian"'
  'ml     "Malayalam"'
  'mr     "Marathi"'
  'nb-NO  "Norwegian (Bokmal)"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'nso    "Northern Sotho (Sesotho sa lebowa)"'
  'or     "Oriya"'
  'pa-IN  "Punjabi"'
  'pl     "Polish"'
  'pt-BR  "Brazilian Portuguese"'
  'pt-PT  "Portuguese"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhalese"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'son    "Songhai"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'ta-LK  "Tamil (Sri Lanka)"'
  'ta     "Tamil"'
  'te     "Telugu"'
  'th     "Thai"'
  'tr     "Turkish"'
  'uk     "Ukrainian"'
  'vi     "Vietnamese"'
  'zh-CN  "Chinese (simplified)"'
  'zh-TW  "Chinese (traditional)"'
  'zu     "Zulu"'
)

pkgname=()
source=()
_url=http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/$pkgver/linux-i686/xpi

for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=firefox-i18n-${_locale,,}

  pkgname+=($_pkgname)
  source+=("firefox-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 language pack for Firefox"
  install -Dm644 firefox-i18n-$pkgver-$1.xpi \
    "$pkgdir/usr/lib/firefox/extensions/langpack-$1@firefox.mozilla.org.xpi"
}
md5sums=('597e3ef4a20841b5bec461634bb46a6d'
         '0b89340b7cab8803fe5f86c627d52770'
         'c2a3a0fe444fa389f61339ad5d189fdc'
         'f32fb82611adb9422cb88599f1c0eb56'
         '9372776226c93de0115e3cef93477f7a'
         '1148ca8998b7a13ec415328da3ec311b'
         '0bf3d930144ce0649a7c42f29316092e'
         '2e89e7fceca13697bb2f434913b2975a'
         '7a35eb4ec90cc6dd0ea3fe83f92304dc'
         '3a3d215e72bf6dea35f8da0a0dca6fc5'
         '085cc2de9c4bbb541d29ddc5aeb4fbb5'
         'dbd5046c3d3dab6c4fefef999fe50781'
         'c38a2f030b88f65681610f3bf60b96c9'
         '82d0b81be13d1e584a5d92709529440c'
         '8e5f36b655ac2a1ef63d57bca9b492eb'
         'aece86a38b9f6d20352426f1ccdfa1fb'
         '0a0f93a504fb87ff26afffa8c84aa12e'
         'd9e685e55d32caf84f419f72a1c468ec'
         '50b88fdc3782f106ef86fe87ebdeac8c'
         '553f17d16fa89063675ffcef806feb89'
         '2b2eb97db05c4b7b6fc0d42c57f4e27a'
         '9739ad4f2a26d964d20d95c0e6e89236'
         '86a3fd95c1f3217300ee0e289a834030'
         '3d175fbe1b1970e70b3f62af3b900525'
         'cb35fbc928fe465a3bc934b1f6bb745f'
         '50437c49670acab136604b505b404b20'
         'cf7ddc9b121746963c937199a33d92d7'
         '7faf0ba42b4233a103a37899afabe2ae'
         'aaaf844852925aa7071233c6f09ab91a'
         '06c41a72518f06bf93eae67584a6485d'
         '935f2c53f26e3a353db73cf29307f569'
         'aecf7230cb90ca550370c578238ce5a4'
         'f2de7bfe152ad2797fba831c197d388c'
         'a68ad8ca8569beb99f680239986db0cf'
         '94e8e358b0f092618c3acf57b1d0906f'
         '14f889b49e889293d51721337c33a4d2'
         '44b618e828a07d7446b095934c56d5e9'
         'd53b4f6a29ded966b9d187ffd05e4b70'
         'de0ac2693ed958604ded2f23636effbf'
         '1618522eb50f173acec7f092c7c96f39'
         '26db544175c2bcbce4ce30d160cedc87'
         'b99c07102adab6c7e5fa5f1cb15c5f76'
         '8e0396a4f6474a35c4918de2784c5221'
         '4b74f98a3342db51c2ec77ed16b8556b'
         'a91b96f872177553e7690f244bff7462'
         '11ed58204ca499e790d192d0bd25b2b3'
         '97605ae1cfee9bbd73ef64502fcf74c0'
         'a5e0b54c1b62e8230e68f9e08885d60b'
         '04fc0ec71cb3737ac22fbca8972836ba'
         'ce7057480c8e8c6cb4628881aa282935'
         '1c67943a68874b8bbd1247c2b182c392'
         '5ff652376c9f8b8cebf35289691d4ea4'
         '969767e3b6f854678d7a14540b06dfd0'
         'f12c9f983d359de24e81dc6537272bee'
         '4d1612c3479b8425fd0d59d7f6f8c62f'
         '1438937613d33972e169c73e4c623dab'
         'f43bb1be2f6010ae2aca60d1f4afc41d'
         '1834a840381523dfe342e16f8ff981cd'
         '4cef624804aedc2a1e03b59fe4e240ae'
         '8b8c116f33b2a2c2339b6d7086b613e4'
         'c5014cc33ffa8f6fb77deb99f44ee7c5'
         'd1063014c0c76e8c859f8344cba32c70'
         '3cf5a45579f12400518dc71347e673c1'
         'd2915e7ac4fabada4c3724e784171320'
         'c959f7257ba9ffc8b5c7f6a356ae23cc'
         '5c8f905eebdc01706474711024787e37'
         '959e327c760433883fa99391983c1d92'
         '289c26f04aac9162f97cfcf119e047a1'
         'baa58c0da97b9f00c40b7fac5649917e'
         '1c73ed43e67724374a6d63ded286853b'
         '2ff6dba5d558be87f55685ce5847f237'
         'bbde96f321c72b9e36ba4858152e0abc'
         '41223f817c308106b4d6cd36472971bd'
         '874fd27d3497ce8861f59898d4ca071e'
         '591270d06d4465ca12e4f0af8e877e04'
         '5ca701859cccf06e76a57a0f058844cd'
         '5ac2747d887a0d45a30679664dd36af5'
         '2599b9f22a873a69bf4fc1d8df35b1a8'
         'ac9b4e003bbcbff1fffade3dac13cda1'
         '83c02b0e4a0632a585fc604a5034e2b7'
         'ecb95562b073024cb51d179e1b28417e'
         'cbce947435041ff404b7b127429a66ab'
         '52a316fd6f158ff05350aba2f3c8ddda'
         '579c897bd19c133d26c3a9bb99db25a7'
         'd9cfd223fd70df09c6f9d5e479ab76b6'
         '9c4a74f244eeb96bafc2f10f9eb71e6d'
         'b3cd3bf0724be59bdc35e0e8fe87536c'
         'e837b3b7f94de1d980b786d115f99e5c'
         'a89fbe66af0b56518e94471b32517a5d')
